using System;
using bitzhuwei.Compiler;

namespace bitzhuwei.AnsiCFormat {
    /// <summary>
    /// Correspond to the Vn node type_specifier in the grammar(AnsiC).
    /// </summary>
    internal partial class Vntype_specifier : IFullFormat {
        // [091] type_specifier = 'void' ;
        // [092] type_specifier = 'char' ;
        // [093] type_specifier = 'short' ;
        // [094] type_specifier = 'int' ;
        // [095] type_specifier = 'long' ;
        // [096] type_specifier = 'float' ;
        // [097] type_specifier = 'double' ;
        // [098] type_specifier = 'signed' ;
        // [099] type_specifier = 'unsigned' ;
        // [100] type_specifier = struct_or_union_specifier ;
        // [101] type_specifier = enum_specifier ;
        // [102] type_specifier = 'type_name' ;


        private readonly IFullFormat complex;

        private readonly TokenRange _scope;
        public TokenRange Scope => _scope;
        public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
            context.PrintBlanksAnd(this.complex, preConfig, writer);
        }


        // [091] type_specifier = 'void' ;
        public Vntype_specifier(Token r0) {
            this.complex = new complex0(r0);
            this._scope = new TokenRange(r0);
        }
        class complex0 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                context.PrintBlanksAnd(r0, preConfig, writer);
            }
            public readonly Token r0;
            public complex0(Token r0) {
                this.r0 = r0;
                this._scope = new TokenRange(r0);
            }
        }

        // [092] type_specifier = 'char' ;
        // complex1 repeated with complex0

        // [093] type_specifier = 'short' ;
        // complex2 repeated with complex0

        // [094] type_specifier = 'int' ;
        // complex3 repeated with complex0

        // [095] type_specifier = 'long' ;
        // complex4 repeated with complex0

        // [096] type_specifier = 'float' ;
        // complex5 repeated with complex0

        // [097] type_specifier = 'double' ;
        // complex6 repeated with complex0

        // [098] type_specifier = 'signed' ;
        // complex7 repeated with complex0

        // [099] type_specifier = 'unsigned' ;
        // complex8 repeated with complex0

        // [100] type_specifier = struct_or_union_specifier ;
        public Vntype_specifier(Vnstruct_or_union_specifier r0) {
            this.complex = new complex9(r0);
            this._scope = new TokenRange(r0);
        }
        class complex9 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                context.PrintBlanksAnd(r0, preConfig, writer);
            }
            public readonly Vnstruct_or_union_specifier r0;
            public complex9(Vnstruct_or_union_specifier r0) {
                this.r0 = r0;
                this._scope = new TokenRange(r0);
            }
        }

        // [101] type_specifier = enum_specifier ;
        public Vntype_specifier(Vnenum_specifier r0) {
            this.complex = new complex10(r0);
            this._scope = new TokenRange(r0);
        }
        class complex10 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                context.PrintBlanksAnd(r0, preConfig, writer);
            }
            public readonly Vnenum_specifier r0;
            public complex10(Vnenum_specifier r0) {
                this.r0 = r0;
                this._scope = new TokenRange(r0);
            }
        }

        // [102] type_specifier = 'type_name' ;
        // complex11 repeated with complex0



    }
}
